package avicit.bdp.dds.server.worker.task.sparkflow.utils;

public enum StopState {
    INIT("INIT", "init"),
    STARTED("STARTED", "started"),
    COMPLETED("COMPLETED", "completed"),
    FAILED("FAILED", "failed"),
    KILLED("KILLED", "killed");

    private final String value;
    private final String text;

    private StopState(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public String getValue() {
        return value;
    }

    public static StopState selectGender(String name) {
        for (StopState state : StopState.values()) {
            if (name.equalsIgnoreCase(state.name())) {
                return state;
            }
        }
        return null;
    }
}
